home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI584.ASC
< prev
next >
Wrap
Text File
|
1992-12-08
|
5KB
|
199 lines
PRODUCT : Paradox NUMBER : 584
VERSION : All
OS : DOS
DATE : December 8, 1992 PAGE : 1/3
TITLE : Copying records using SETKEY
Description of the CPYNPST script
Frequently in Paradox, when editing or coediting records, the
need may arise to make a copy of a complete record in a table.
While Paradox does provide a Ditto key <Ctrl - D>, the range of
this key is limited to copying a single field.
This example script uses the PAL SETKEY command, in conjunction
with the COPYTOARRAY, and COPYFROMARRAY commands, to provide the
function of copying a complete record in a table.
Creating the CPYNPST script
From the Paradox Main Menu select:
1. Scripts
2. Editor
3. New (For versions earlier than 4.0, select Write)
4. At the 'Script:' prompt, type in: CPYNPST <ENTER>
5. Type the following text into the script editor as two
single lines: (Due to printer output constraints, the text
of each single line is printed on two separate lines. In
the first example, the line which begins with the 'record"
sleep 2000' should be appended in your editor to the end
of the previous line.)
Line one of text:
SETKEY -46 copytoarray clip message "Copying current
record" sleep 2000; <Alt - C>
Line two of text:
SETKEY -25 ins copyfromarray clip message "Pasting stored
record" sleep 2000; <Alt - P>
6. Press F2 to save the script file CPYNPST.SC
PRODUCT : Paradox NUMBER : 584
VERSION : All
OS : DOS
DATE : December 8, 1992 PAGE : 2/3
TITLE : Copying records using SETKEY
The first SETKEY macro sets a hotkey for the keycode "-46", which
is the representation for <Alt - C>. The second SETKEY macro
sets a hotkey for the keycode "-25", which is the representation
for the <Alt - P>. For a list of other keys or combinations of
keys that can be used, refer to Appendix G of the PAL Reference
Guide (for versions earlier than 4.0, refer to the Appendix B of
the PAL User's Guide). The "sleep 2000" statement causes a 2
second delay (2000 milliseconds) and is used in the examples in
this Technical Information sheet to pause the message on the
screen.
Using the CPYNPST Script
To initialize the <Alt - C> and <Alt - P> keys for Cutting and
Pasting, select from the Paradox Main menu:
1. Scripts
2. Play
3. At the 'Script:' prompt type in: CPYNPST <ENTER>
Once the script has been played, the <Alt - C> key will store the
record at current cursor position. The <Alt - P> key will insert
a new blank record and paste a copy of the stored record.
Additional examples/variations
To physically move a record, to cut and paste a record, the above
example setkeys could be modified as follows:
SETKEY -46 copytoarray clip del message "Cutting current record"
sleep 2000; <Alt - C>
SETKEY -25 ins copyfromarray clip message "Pasting stored record"
sleep 2000; <Alt - P>
Below is an example SETKEY definition which will ditto the
previous record into the current record position:
SETKEY -32 up copytoarray x down ins copyfromarray x message
"Copying record" sleep 2000; <Alt - D>
PRODUCT : Paradox NUMBER : 584
VERSION : All
OS : DOS
DATE : December 8, 1992 PAGE : 3/3
TITLE : Copying records using SETKEY
(Again in your script, each SETKEY definition must be entered on
a single line.) For additional information about the SETKEY
command, refer to the Chapter 20 of the PAL Programmer's Guide
(for versions earlier than 4.0, refer to Chapter 16 of the PAL
User's Guide).
If you wish to have the setkeys loaded automatically when you
start Paradox, you can place the lines of PAL SETKEY code into an
INIT script that is located in your private directory. If you
are not using a private directory, then the INIT script should be
in the directory where Paradox was installed, for example,
PDOX40. The INIT script is a Paradox program that runs
automatically when Paradox is started like an Autoexec.bat file
runs automatically when a computer is booted. For additional
information on INIT scripts, refer to the the PAL Programmer's
Guide (for versions earlier than 4.0, refer to the PAL User's
Guide).
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.